<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="com.zafu.dao.GoodsBean" %>
<%@ page import="com.zafu.entity.GoodsInfo" %><%--
  Created by IntelliJ IDEA.
  User: 86189
  Date: 2024/12/20
  Time: 20:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    GoodsBean bean = new GoodsBean();
    ArrayList<GoodsInfo> data = bean.GetAll();
    StringBuilder builder = new StringBuilder();
    out.println("<Store>");
    Iterator<GoodsInfo> iter = data.iterator();
    while (iter.hasNext()) {
        GoodsInfo info = iter.next();
        builder.append(info.toString()).append("\n");

        out.println("<Goods>");
        out.println("<name>" + info.getName() + "</name>");
        out.println("<comment>" + info.getComment() + "</comment>");
        out.println("<info>" + info.getInfo() + "</info>");
        out.println("<image>" + info.getImage() + "</image>");
        out.println("<store>" + info.getStore() + "</store>");
        out.println("<price>" + info.getPrice() + "</price>");
        out.println("</Goods>");
    }
    out.println("</Store>");
    System.out.printf(builder.toString());
%>
